package errorcode

func msgInit() {
	errorMsg = make(map[uint]string)
	errorMsg[EC_GL_SUCCESS] = "成功"
	errorMsg[PM_LOGIN_PERMISSION_DENIDE] = "您需要先登录才能操作哟~"
	errorMsg[EC_GL_INVALID_ACCESS_TOKEN] = "无效的access_token，未登录"
	errorMsg[EC_GL_INVALID_APPKEY] = "未授权的appkey"
	errorMsg[EC_GL_INVALID_IP] = "请求者的IP被封禁"
	errorMsg[EC_GL_INVALID_URL_TIME] = "URL时间戳差距过大，拒绝服务"
	errorMsg[EC_GL_INVALID_URL_SIGN] = "URL签名非法"
	errorMsg[EC_GL_INVALID_SERVICE] = "同步服务非法"
	errorMsg[EC_GL_INVALID_SESSIONID] = "会话id错误"
	errorMsg[EC_GL_INVALID_HTTPS] = "必须是https请求"
	errorMsg[EC_GL_INVALID_URL_PARAMS] = "URL参数非法 "

	errorMsg[EC_GL_INVALID_JSON_BODY] = "无法解析的body json字符串"

	errorMsg[EC_GL_INTERNAL_ERROR] = "服务器内部错误"
	errorMsg[EC_GL_NO_DATA] = "没有数据"

	//业务错误码对应msg

}

func Msg(errcode uint) string {
	if msg, ok := errorMsg[errcode]; ok {
		return msg
	}
	return ""
}
